<script setup lang="ts">
import { inject } from 'vue'

// 通过 inject 接收并使用 Provide 注入的值
const rootCount = inject<number>('count')
const updateCount = inject<(num: number) => void>('updateCount')

</script>

<template>
  <div class="child-page" style="padding: 50px; border: 10px solid #ccc">
    <h3>{{ rootCount }}</h3>
    child 组件  <button @click="updateCount!(52)">修改count</button>
  </div>
</template>